﻿@model IEnumerable<AppStore.Domain.Entities.Application>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Index</h2>

@{
    int iteration = 0;
    
    foreach (var item in Model)
    {
        if( (iteration % 3) == 0)
        {
            <div class="product_box no_margin_right">
                <img src="images/product/01.jpg" alt="Image 01" />
                <h3>@Html.DisplayFor(modelItem => item.name)</h3>
                <p class="product_price">$@Html.DisplayFor(modelItem => item.price)</p>
                @Html.ActionLink("Szczegóły", "Details", "Application", new { applicationId = item.applicationId }, new { @class = "detail" })
            </div>
        }
        else
        {
            <div class="product_box">
                <img src="images/product/01.jpg" alt="Image 01" />
                <h3>@Html.DisplayFor(modelItem => item.name)</h3>
                <p class="product_price">$@Html.DisplayFor(modelItem => item.price)</p>
                @Html.ActionLink("Szczegóły", "Details", "Application", new { applicationId = item.applicationId }, new { @class = "detail" })
            </div>
        }
        
    iteration++;
    }
}

